package com.example.hotelrear.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.hotelrear.entity.Room;
import com.example.hotelrear.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
<<<<<<< HEAD
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

=======
import org.apache.ibatis.annotations.Mapper;
>>>>>>> c858df565d55deb60e87bd48c878762d1fd5080a

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author FengXiao
 * @since 2023-08-28
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user where username=#{username} and password=#{password} and isdelete=0")
    public User login(User user);
    @Select("select * from user where username=#{username}")
    public User regexUsername(String username);
    @Select("select * from user where phone=#{phone}")
    public User regexPhone(String phone);
    @Insert("insert into user(username,password,phone,createtime) values(#{username},#{password},#{phone},now())")
    public int regist(User user);
    @Select("select * from user where id=#{id}")
    public User UserById(int id);
    @Update(" update user set username=#{username},password=#{password},phone=#{phone},createTime=now() where id=#{id};")
    public int updateUser(User user);

}
